<%-- 
    Document   : RequestPopup
    Created on : Aug 27, 2013, 12:07:53 PM
    Author     : ChauAnh
--%>

<%@page import="java.util.Iterator"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.HashMap"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
    <head>
        
        <style type="text/css">
            #srollRequest {
                border: 0px solid gray;
                height:300px;
                width: 300px;                
                overflow-y: auto;                
            }

            #listRequest div{
                float: left;

            }         
            a.deleteRequest:link {color:blue;text-decoration:none;}
            a.deleteRequest:visited {color:blue;text-decoration:none;}
            a.deleteRequest:hover {text-decoration:underline;}

            a.viewRequest:link {color:#A80037;text-decoration:none;font-weight: bold;}
            a.viewRequest:visited {color:#A80037;text-decoration:none;font-weight: bold;}
            a.viewRequest:hover {text-decoration:underline;}

            a.viewRequestTrue:link {color:gray;text-decoration:none;}
            a.viewRequestTrue:visited {color:gray;text-decoration:none;}
            a.viewRequestTrue:hover {text-decoration:underline;}
        </style>
    </head>
    <body>
        <div id="srollRequest" >
            <div colspan="2" align="left" style="background-color: #FFF3DE; height: 30px; padding-left: 10px; padding-top: 5px" class="text-nomarl-title-reb">
                <fmt:message key="pprequest.title"/>
            </div>
            <table style="width: 300px; padding-left: 5px; padding-right: 5px;">
                <%
                    if (request.getSession().getAttribute("listRequest") == null) {
                        response.sendRedirect("index.jsp");
                    } else {
                        HashMap listRequest = (HashMap) request.getSession().getAttribute("listRequest");
                        Set keyRequest = listRequest.keySet();
                        Iterator itr = keyRequest.iterator();
                        while (itr.hasNext()) {
                            Object keyid = itr.next();
                            HashMap hm = (HashMap) listRequest.get(keyid);
                            if (hm.get("status").equals("False") || hm.get("status").equals("false")) {

                %>               
                <tr>                   
                    <td rowspan="3" style="height: 50px; width: 50px">
                        <a href="CandidateProfileDetails?username=<%=hm.get("username")%>" style="text-decoration: none">
                            <img style="border: 2px dotted #CCCCCC;" src="avatar/<%=hm.get("avatar")%>" width="50px" height="50px" alt="avatar"/>
                        </a> 
                    </td>
                </tr>
                <tr >                               
                    <td style="width: 230px" class="text-nomarl-reb" align="left">
                        <a class="viewRequest" href="CandidateProfileDetails?username=<%=hm.get("username")%> " >
                            <%=hm.get("first_name") + " " + hm.get("middle_name") + " " + hm.get("last_name")%>
                        </a>
                    </td> 
                    <td class="text-nomarl-blue" rowspan="3">
                        <a class='deleteRequest' href='DeleteRequest?id_send_request=<%=hm.get("id_send_request")%>' style="text-decoration: none" onclick="return confirm('<fmt:message key="pprequest.areyousure"/>');">
                            <img border="0" src="images/DeleteRequest.png" width="20px" height="20px" alt="Delete" title='<fmt:message key="pprequest.delete"/>'/>
                        </a>    
                    </td>
                </tr>
                <tr style="font-style: italic" class="text-nomarl-reb" align="left">
                    <td>
                        <%=hm.get("date")%>
                    </td>
                </tr>                
                <%
                } else {
                %>
                <tr>                   
                    <td rowspan="3" style="height: 50px; width: 50px">
                        <a href="CandidateProfileDetails?username=<%=hm.get("username")%> " style="text-decoration: none">
                            <img style="border: 2px dotted #CCCCCC;" src="avatar/<%=hm.get("avatar")%>" width="50px" height="50px" alt="banerbg"/>
                        </a> 
                    </td>
                </tr>
                <tr>                               
                    <td style="width: 230px" class="text-nomarl-grey" align="left">
                        <a  class="viewRequestTrue" href="CandidateProfileDetails?username=<%=hm.get("username")%> ">
                            <%=hm.get("first_name") + " " + hm.get("middle_name") + " " + hm.get("last_name")%>
                        </a>
                    </td>
                    <td rowspan="3" class="text-nomarl-blue">
                        <a class='deleteRequest' href='DeleteRequest?id_send_request=<%=hm.get("id_send_request")%>' style="text-decoration: none" onclick="return confirm(<fmt:message key="pprequest.areyousure"/>);">
                            <img border="0" src="images/DeleteRequest.png" width="20px" height="20px" alt="Delete" title='<fmt:message key="pprequest.delete"/>'/>
                        </a>   
                    </td>
                </tr>
                <tr>
                    <td class="text-nomarl-grey" style="font-style: italic" align="left">
                        <%=hm.get("date")%>
                    </td>
                </tr>
                <%
                            }
                        }
                    }
                %>
            </table>
        </div>
    </body>
</html>
